<?php require_once('../../../Connections/ocmanmanager.php'); 
require_once('../../../Connections/checkuser.php'); ?>
<?php

//mysql_select_db($database_ocmanmanager, $ocmanmanager);
//$query_issuestatusview = "SELECT * FROM issuesstatusview ORDER BY project,issuestatus ASC";
/*$query_issuestatusview = "SELECT
    `issuetable`.`id`
    , `issuetable`.`projectid`
    , `issuetable`.`taskid`
    , `issuetable`.`issuewithbusinessid`
    , `issuetable`.`issuetitle`
    , `issuetable`.`issuedescription`
    , `issuetable`.`datecreated`
    , `issuetable`.`notes`
    , `issuetable`.`issuestatusid`
    , `issuesstatus`.`statustitle`
    , `projects`.`projectname`
FROM
    `ocmanozc_manager`.`issuetable`
    INNER JOIN `ocmanozc_manager`.`issuesstatus` 
        ON (`issuetable`.`issuestatusid` = `issuesstatus`.`id`)
    INNER JOIN `ocmanozc_manager`.`projects` 
        ON (`issuetable`.`projectid` = `projects`.`id`)
    ORDER BY projectname,statustitle ASC";
//$issuestatusview = mysql_query($query_issuestatusview, $ocmanmanager) or die(mysql_error());
//$row_issuestatusview = mysql_fetch_assoc($issuestatusview);
//$totalRows_issuestatusview = mysql_num_rows($issuestatusview);*/


/*mysql_select_db($database_ocmanmanager, $ocmanmanager);
$query_issue = sprintf("SELECT * FROM issuetable WHERE id = %s", GetSQLValueString($colname_issue, "int"));
$issue = mysql_query($query_issue, $ocmanmanager) or die(mysql_error());
$row_issue = mysql_fetch_assoc($issue);
$totalRows_issue = mysql_num_rows($issue);*/

mysql_select_db($database_ocmanmanager, $ocmanmanager);
$query_issuestatusview = "SELECT * FROM issuesstatusview ORDER BY projectname,issuestatus ASC";
$issuestatusview = mysql_query($query_issuestatusview, $ocmanmanager) or die(mysql_error());
$row_issuestatusview = mysql_fetch_assoc($issuestatusview);
$totalRows_issuestatusview = mysql_num_rows($issuestatusview);
?>
<!DOCTYPE html> 
<html>
<head>
<meta charset="utf-8">
<title>Ozcrete Mobile - Projects</title>
<meta name="viewport" content="width=device-width, initial-scale=1"> 
	<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
	<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
	<script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
</head> 
<body> 

<div id="page" data-role="page" data-theme="b">
	<div data-role="header">
		<h1>Issues List</h1>
	</div>
    <div class="ui-grid-a">
			<div class="ui-block-a" style="width:30%;">
			  <ul data-role="listview" data-split-icon="arrow-r" data-theme="c">
			    <li><a href="index.php">Projects</a></li>
			    <li><a href="issues.php">Issues</a></li>
			    <li><a href="orders.php">Orders</a></li>
		      </ul>
</div>
			<div class="ui-block-b" style="width:70%;"><div data-role="content">	
		<ul data-role="listview" data-split-icon="arrow-r" data-theme="c" data-filter="true">
        <?php $oldproject=-1; ?>
			<?php do { ?>
            <?php if($oldproject!=$row_issuestatusview['projectid']) { ?>
            <li data-role="list-divider"><?php echo $row_issuestatusview['projectname']; ?></li>
            <?php $oldproject=$row_issuestatusview['projectid']; ?>
            <?php } ?>
			  <li>
 
              <a href="issue.php?id=<?php echo $row_issuestatusview['id']; ?>" data-transition="slide">
			  [<?php echo date('D, m/d/Y',strtotime($row_issuestatusview['datecreated'])); ?>] <?php echo ucfirst($row_issuestatusview['issuetitle']); ?> 
              </a>
              <span class="ui-li-count">
			  	<?php echo $row_issuestatusview['issuestatus']; ?>
              </span>
              </li>
			  
              <?php } while ($row_issuestatusview = mysql_fetch_assoc($issuestatusview)); ?>
		</ul>		
	</div></div>
		</div><!-- /grid-a -->
        
	
	<!--div data-role="footer">
		<h4>Ozcrete Pools</h4>
	</div--    >
</div>



</body>
</html>
<?php
mysql_free_result($issuestatusview);
?>
